﻿using System;
using System.Collections.Generic;
using System.Web;

namespace ${project}.${app}.Models.Tips.Common
{
    public class ${table.name}
    {
		${foreach(field in table.fields)}
		public string ${field.name}=null;
		${end}
        public string __name__;
        public ${table.name}(string name)
        {
            this.__name__ = name;
			${foreach(field in table.fields)}
			this.${field.name} = string.Format("{0}.${field.name}",__name__);
			${end}
        }
        public ${table.name}()
        {
            ${foreach(field in table.fields)}
			this.${field.name} = string.Format("{0}.${field.name}",__name__);
			${end}
        }
        public override string ToString()
        {
            if (__name__ == null)
            {
                return "${table.name}";
            }
            else
            {
                return string.Format("${table.name} as {0}",__name__);
            }
        }
    }
}